package com.baoyouqun.domain.CreateCmd;

import com.baoyouqun.base.utils.EnumValidator.ValidEnum;
import com.baoyouqun.domain.Enum.DemandTypeEnum;
import com.baoyouqun.domain.Enum.PhonePrivacyEnum;
import com.baoyouqun.domain.Enum.ResourceUrgencyEnum;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

@Data
public class DemandCreateCmd implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "发布用户ID")
    private String userId;

    @ApiModelProperty(value = "发布类型")
    @NotNull(message = "发布类型不能为空")
    @ValidEnum(enumClass = DemandTypeEnum.class, message = "无效的发布类型")
    private DemandTypeEnum type;

    @ApiModelProperty(value = "地区code")
    private String cityCode;

    @ApiModelProperty(value = "展示地区（省市县拼接）")
    private String cityName;

    @ApiModelProperty(value = "标签")
    private String tag;

    @ApiModelProperty(value = "行业")
    private String industry;

    @ApiModelProperty(value = "需求标题")
    @NotBlank(message = "需求标题不能为空")
    private String title;

    @ApiModelProperty(value = "需求描述")
    @NotBlank(message = "需求描述不能为空")
    private String description;

    @ApiModelProperty(value = "附件")
    private List<String> fileList;

    @ApiModelProperty(value = "手机号隐私保护*")
    @ValidEnum(enumClass = PhonePrivacyEnum.class, message = "无效的手机号隐私保护类型")
    private PhonePrivacyEnum phonePrivacy;

    @ApiModelProperty(value = "资源紧急程度")
    @ValidEnum(enumClass = ResourceUrgencyEnum.class, message = "无效的资源紧急程度类型")
    private ResourceUrgencyEnum resourceUrgency;

    @ApiModelProperty(value = "是否长期有效")
    private Boolean neverExpire;

    @ApiModelProperty(value = "过期时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime expireTime;


}